/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const process = require('process');

switch (process.env.NODE_ENV) {
    case 'development':
        process.env.API_URL = 'https://127.0.0.1';
        break;
    case 'production':
        process.env.API_URL = 'https://127.0.0.1';
        break;
    case 'test':
        process.env.API_URL = 'https://127.0.0.1';
        break;
}

module.exports = {
    webpack: {
        // configure: (webpackConfig, arg) => {
        //     return webpackConfig;
        // },
        alias: {
            // 约定：使用 @ 表示 src 文件所在路径
            '@': path.resolve(__dirname, 'src'),
        },
    },
    devServer: {
        client: {
            overlay: false, // 禁用全局错误提示
        },
    },
    plugins: [
        {
            plugin: require('craco-cesium')(),
        },
    ],
};
